﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;

namespace AutomationResearch
{
    /// <summary>
    /// The collection class that will store the list of each element/item that
    ///        is returned back from the configuration manager.
    /// </summary>
    [ConfigurationCollection(typeof(AutoBotConfigElement))]
    public class AutoBotConfigCollection : ConfigurationElementCollection
    {
        protected override ConfigurationElement CreateNewElement()
        {
            return new AutoBotConfigElement();
        }

        protected override object GetElementKey(ConfigurationElement element)
        {
            return ((AutoBotConfigElement)(element)).Duration;
        }

        public AutoBotConfigElement this[int idx]
        {
            get
            {
                return (AutoBotConfigElement)BaseGet(idx);
            }
        }

        new public AutoBotConfigElement this[string key]
        {
            get
            {
                return (AutoBotConfigElement)BaseGet(key);
            }

        }
    }
}
